package cn.ustb.dao;

import cn.ustb.entity.CetGrade;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface CetGradeDao {
    @Select({"<script>",
            "select * from cetgrade where studentId = #{studentId}",
            "<if test = \"yearTerm!=null\">"+
                    " and yearTerm like concat('%',concat(#{yearTerm},'%'))"+
                    " </if>",
            "</script>"
    })
    List<CetGrade> getAllWithYearTerm(@Param("studentId") String studentId, @Param("yearTerm") String yearTerm);

    @Select("select * from cetGrade where studentId = #{studentId}")
    List<CetGrade> getAllLevelWithStudentId(String studentId);
}
